/*
 * @Author: your name
 * @Date: 2021-12-04 20:18:27
 * @LastEditTime: 2021-12-04 21:14:02
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \li-yuwei\admin\src\api\comments\index.js
 */
import request from "../../utils/request";

function getCommentList(data) {
    return request({
        url: "/api/comments",
        method: "get",
        params: data,
    });
}

function addCommentList(data) {
    return request({
        url: "/api/comments",
        method: "post",
        data: data,
    });
}

function delCommentList(id) {
    return request({
        url: `/api/comments/${id}`,
        method: "delete",
    });
}

function changeCommentState(data) {
    return request({
        url: "/api/comments",
        method: "put",
        data: data,
    });
}

function batchDelComments(data) {
    return request({
        url: "/api/batch/comments",
        method: "delete",
        data: data,
    });
}

function batchPassComments(data) {
    return request({
        url: "/api/pass/comments",
        method: "put",
        data: data,
    });
}

function batchRefuseComments(data) {
    return request({
        url: "/api/refuse/comments",
        method: "put",
        data: data,
    });
}

function passComment(data) {
    return request({
        url: "/api/pass/comment",
        method: "put",
        data: data,
    });
}

function refuseComment(data) {
    return request({
        url: "/api/refuse/comment",
        method: "put",
        data: data,
    });
}
export default {
    getCommentList,
    addCommentList,
    delCommentList,
    changeCommentState,
    batchDelComments,
    batchPassComments,
    batchRefuseComments,
    passComment,
    refuseComment,
};